| Conditions | 3 |
| Paths | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | import path from 'path' |
||
| 9 | var route = function(req, res, next){ |
||
| 10 | abeExtend.hooks.instance.trigger('beforeRoute', req, res, next) |
||
| 11 | if(typeof res._header !== 'undefined' && res._header !== null) return |
||
| 12 | |||
| 13 | var p = cmsOperations.post.reject( |
||
| 14 | req.body.filePath, |
||
| 15 | req.body.tplPath, |
||
| 16 | req.body.json |
||
| 17 | ); |
||
| 18 | |||
| 19 | p.then((result) => { |
||
| 20 | res.set('Content-Type', 'application/json') |
||
| 21 | res.send(JSON.stringify(result)) |
||
| 22 | }, |
||
| 23 | (result) => { |
||
| 24 | res.set('Content-Type', 'application/json') |
||
| 25 | res.send(JSON.stringify(result)) |
||
| 26 | }).catch(function(e) { |
||
| 27 | console.error('[ERROR] post-reject.js', e) |
||
| 28 | }) |
||
| 29 | } |
||
| 30 | |||
| 31 | export default route |